#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

void elimDups(vector<string> &words) {
  for (int i = 0; i < words.size(); ++i) {
    cout << words[i] << " ";
  }
  cout << endl;
  sort(words.begin(), words.end());
  for (int i = 0; i < words.size(); ++i) {
    cout << words[i] << " ";
  }
  cout << endl;
  auto end_unique = unique(words.begin(), words.end());
  words.erase(end_unique, words.end());
  for (int i = 0; i < words.size(); ++i) {
    cout << words[i] << " ";
  }
  cout << endl;
}

int main(int argc, char const *argv[]) {
  /* code */
  vector<string> v = {"fox", "jumps", "over", "quick", "red",
                      "red", "slow",  "the",  "the",   "turtle"};
  elimDups(v);
  return 0;
}
